Ext.define('ProjectAON.view.leerlingenBeheren.Scherm31', {
    extend:'Ext.panel.Panel',
    alias:'widget.scherm31',

    title:'Leerlingen Beheren',
    id:'scherm31',
    requires:[
        'ProjectAON.view.leerlingenBeheren.List',
        'ProjectAON.view.leerlingenBeheren.Insert',
        'ProjectAON.view.leerlingenBeheren.Edit'
    ],

    stores:[
        'BeheerLeerling'
    ],
    models:['BeheerLeerling'],

    initComponent:function () {
        var me = this;
        Ext.applyIf(this, {
            layout:'border',
            items:[

                {
                    collapsible:false,
                    region:'north',
                    resizable:false,
                    xtype:'panel',
                    items:[
                        {
                            xtype:'button',
                            text:'Terug',
                            icon:'http://whatisextjs.com/BAHO/icons/page_back.png',
                            action:'back'
                        },
                        {
                            xtype:'button',
                            text:'Toevoegen',
                            icon:'http://whatisextjs.com/BAHO/icons/add.png',
                            action:'add'
                        },
                        {
                            xtype:'button',
                            text:'Bewerken',
                            icon:'http://whatisextjs.com/BAHO/icons/bullet_edit.png',
                            action:'edit'
                        },
                        {
                            xtype:'button',
                            text:'Verwijderen',
                            icon:'http://whatisextjs.com/BAHO/icons/delete.png',
                            action:'remove'
                        },
                        {
                            xtype:'textfield',
                            emptyText:'Zoekopdracht',
                            fieldLabel:'Zoek:',
                            cls:'zoekButton',
                            name:'searchField',
                            listeners:{
                                change:{
                                    fn:me.searchGrid,
                                    scope:this,
                                    buffer:100
                                }
                            }
                        }
                    ]
                },
                {
                    collapsible:false,
                    region:'center',
                    width:Ext.getBody().getViewSize().width - 100,
                    layout:'fit',
                    items:[
                        {
                            xtype:'studentlist'
                        }

                    ]
                }
            ]
        });

        this.callParent(arguments);

        Ext.ComponentQuery.query('searchgrid')[0].setTextfieldReference(this.down('textfield[name=searchField]'));
    },

    searchGrid:function () {
        Ext.ComponentQuery.query('searchgrid')[0].onTextFieldChange();
    }
});